<?php

namespace App\Http\Controllers;

use App\Models\Logs;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\DB;
use phpDocumentor\Reflection\DocBlock\Tags\Var_;


class MemberController extends Controller
{
    public function info($id = null)
    {
        // return 'member-class'.$id;
//        return view('welcome');
        return DB::select('select * from logs');
    }

    public function insert($id = null)
    {

//        $r= DB::insert('insert into logs(created_at) values (?)',
//            ['1989-10-10']
//            );
        $r= DB::table('logs')->insertGetId(['created_at'=>'1991-1-1','updated_at'=>'2019-1-1']);
        var_dump($r);
    }

    /**
     * @param null $id
     * @return mixed
     */
    public function orm1($id = null){
//        return Logs::all();
//        return Logs::find(225);
//        return Logs::where('id','>',"200")->first();
        $log1=new Logs();
        $log1->created_at='2018-8-8';
       $r= $log1->save();
        return dd($r);

//        return Logs::where('id','>',"200")->first();
    }
    public function delete($id = null)
    {


        $r= DB::table('logs')->delete(['id'=>$id]);
        var_dump($r);
    }
}
